<template>
	<el-row class="top">
		<el-col :span="20" style="padding-left: 20px;">遛娃运营管理平台</el-col>
		
		<el-col :span="4" style="text-align: right;padding-right: 20px;font-size:14px">
			<span>{{getUser!= null?getUser.name:""}}</span>
		    <el-button type="text" style="padding-left: 10px;color:#fff" @click="logout">退出</el-button>
		</el-col>
	</el-row>
</template>
<script>
	import { getStore } from '@/config/mUtils'
	import { mapGetters } from 'vuex'
	export default {
		data() {
			return {
				activeIndex: this.$route.path,
			};
		},
		computed: {
			...mapGetters(['getUser']),
		},
		methods: {
			handleSelect(key, keyPath) {
				console.log(key, keyPath);
			},
			logout(){
				//控制头部组件显示的状态
				this.$store.commit('changeHeaderShow', false);
				window.localStorage.clear();
				this.$router.push('/');
			}
			
		}
	}
</script>
<style scoped>
	.top{
		line-height: 60px;
		background-color: #20a0ff;
		font-size: 24px;
		color:#fff;
		font-weight: 700;
	}
	.el-col .el-button {
	    font-size: 14px;
	}
</style>